package com.longxi.tianjintianbao.utils;

import android.app.Activity;
import android.content.Intent;

import com.longxi.tianjintianbao.AppConst;
import com.longxi.tianjintianbao.MyApplication;
import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.model.Personnel;
import com.longxi.tianjintianbao.ui.activity.department.DepartmentActivity;
import com.longxi.tianjintianbao.ui.adapter.GridImageAdapter;
import com.longxi.tianjintianbao.ui.adapter.GridPersonnelAdapter;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.entity.LocalMedia;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import static com.luck.picture.lib.config.PictureMimeType.ofImage;

/**
 * 选择员工用utils 位置要改
 */
public class AddPerUtils {

    private static AddPerUtils mInstance;
    Activity mContext;
    public List<Personnel> selectList = new ArrayList<>();
    public int maxSelectNum = 100;//最多选多少人
    public boolean isMulti = true;//true表示多选 false表示单选

    public AddPerUtils(Activity context){
        mContext = context;
    }

    public GridPersonnelAdapter.onAddPerClickListener onAddPerClickListener = new GridPersonnelAdapter.onAddPerClickListener() {
        @Override
        public void onAddPerClick() {
            boolean mode = true;
            if (mode) {
                // 进入相册 以下是例子：不需要的api可以不写
                Intent intent = new Intent(MyApplication.getInstance(), DepartmentActivity.class);
                intent.putExtra(AppConst.MULTI_SELECTION, isMulti);
                intent.putExtra(AppConst.PERSONNEL_LISTINTENT, (Serializable) selectList);
                mContext.startActivityForResult(intent, AppConst.IntentRequstCode.ACTIVITY_PERSONNEL);
            }
        }

        @Override
        public void onDeletePer(Personnel personnel) {

        }

        @Override
        public void onPreview(int position) {

        }
    };

}
